/* generated using openapi-typescript-codegen -- do no edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { BaseResponseBoolean } from "../models/BaseResponseBoolean";
import type { BaseResponseListTop10VO } from "../models/BaseResponseListTop10VO";
import type { BaseResponseLoginUserVO } from "../models/BaseResponseLoginUserVO";
import type { BaseResponseLong } from "../models/BaseResponseLong";
import type { BaseResponsePageUser } from "../models/BaseResponsePageUser";
import type { BaseResponseTop10VO } from "../models/BaseResponseTop10VO";
import type { BaseResponseUser } from "../models/BaseResponseUser";
import type { BaseResponseUserAcceptedQuestionVO } from "../models/BaseResponseUserAcceptedQuestionVO";
import type { DeleteRequest } from "../models/DeleteRequest";
import type { UserAddRequest } from "../models/UserAddRequest";
import type { UserLoginRequest } from "../models/UserLoginRequest";
import type { UserQueryRequest } from "../models/UserQueryRequest";
import type { UserUpdateRequest } from "../models/UserUpdateRequest";

import type { CancelablePromise } from "../core/CancelablePromise";
import { OpenAPI } from "../core/OpenAPI";
import { request as __request } from "../core/request";
import { UserChangePasswordRequest } from "../models/UserChangePasswordRequest";
import { BaseResponseTotalInfo } from "../models/BaseResponseTotalInfo";
import { BaseResponseListLong } from "../models/BaseResponseListLong";
import { BatchDeleteRequest } from "../models/BatchDeleteRequest";

export class UserControllerService {
  /**
   * @param requestBody
   * @returns BaseResponseBoolean OK
   * @throws ApiError
   */
  public static updateUser(
    requestBody: UserUpdateRequest
  ): CancelablePromise<BaseResponseBoolean> {
    return __request(OpenAPI, {
      method: "POST",
      url: "/user/update",
      body: requestBody,
      mediaType: "application/json",
    });
  }

  /**
   * @param requestBody
   * @returns BaseResponseBoolean OK
   * @throws ApiError
   */
  public static changePassword(
    requestBody: UserChangePasswordRequest
  ): CancelablePromise<BaseResponseBoolean> {
    return __request(OpenAPI, {
      method: "POST",
      url: "/user/change",
      body: requestBody,
      mediaType: "application/json",
    });
  }

  /**
   * @returns BaseResponseBoolean OK
   * @throws ApiError
   */
  public static userLogout(): CancelablePromise<BaseResponseBoolean> {
    return __request(OpenAPI, {
      method: "POST",
      url: "/user/logout",
    });
  }

  /**
   * @param requestBody
   * @returns BaseResponseLoginUserVO OK
   * @throws ApiError
   */
  public static userLogin(
    requestBody: UserLoginRequest
  ): CancelablePromise<BaseResponseLoginUserVO> {
    return __request(OpenAPI, {
      method: "POST",
      url: "/user/login",
      body: requestBody,
      mediaType: "application/json",
    });
  }

  /**
   * @param requestBody
   * @returns BaseResponsePageUser OK
   * @throws ApiError
   */
  public static pageQueryUser(
    requestBody: UserQueryRequest
  ): CancelablePromise<BaseResponsePageUser> {
    return __request(OpenAPI, {
      method: "POST",
      url: "/user/list/page",
      body: requestBody,
      mediaType: "application/json",
    });
  }

  /**
   * @param requestBody
   * @returns BaseResponseBoolean OK
   * @throws ApiError
   */
  public static deleteUser(
    requestBody: DeleteRequest
  ): CancelablePromise<BaseResponseBoolean> {
    return __request(OpenAPI, {
      method: "POST",
      url: "/user/delete",
      body: requestBody,
      mediaType: "application/json",
    });
  }

  /**
   * @returns BaseResponseBoolean OK
   * @throws ApiError
   */
  public static cleanCommonUser(): CancelablePromise<BaseResponseBoolean> {
    return __request(OpenAPI, {
      method: "POST",
      url: "/user/clean",
      mediaType: "application/json",
    });
  }

  /**
   * @param requestBody
   * @returns BaseResponseBoolean OK
   * @throws ApiError
   */
  public static batchDeleteUser(
    requestBody: BatchDeleteRequest
  ): CancelablePromise<BaseResponseBoolean> {
    return __request(OpenAPI, {
      method: "DELETE",
      url: "/user/batchDelete",
      body: requestBody,
      mediaType: "application/json",
    });
  }

  /**
   * @param requestBody
   * @returns BaseResponseLong OK
   * @throws ApiError
   */
  public static addUser(
    requestBody: UserAddRequest
  ): CancelablePromise<BaseResponseLong> {
    return __request(OpenAPI, {
      method: "POST",
      url: "/user/add",
      body: requestBody,
      mediaType: "application/json",
    });
  }

  /**
   * @param requestBody
   * @returns BaseResponseBoolean OK
   * @throws ApiError
   */
  public static addUserByFile(requestBody?: {
    file: Blob;
  }): CancelablePromise<BaseResponseBoolean> {
    return __request(OpenAPI, {
      method: "POST",
      url: "/user/add/file",
      body: requestBody,
      mediaType: "multipart/form-data",
    });
  }

  /**
   * @returns BaseResponseListTop10VO OK
   * @throws ApiError
   */
  public static getTop10Ranking(): CancelablePromise<BaseResponseListTop10VO> {
    return __request(OpenAPI, {
      method: "GET",
      url: "/user/top10",
    });
  }

  /**
   * @returns BaseResponseTop10VO OK
   * @throws ApiError
   */
  public static getMyRank(): CancelablePromise<BaseResponseTop10VO> {
    return __request(OpenAPI, {
      method: "GET",
      url: "/user/myRank",
    });
  }

  /**
   * @param id
   * @returns BaseResponseUser OK
   * @throws ApiError
   */
  public static getUserById(id: number): CancelablePromise<BaseResponseUser> {
    return __request(OpenAPI, {
      method: "GET",
      url: "/user/get",
      query: {
        id: id,
      },
    });
  }

  /**
   * @returns BaseResponseLoginUserVO OK
   * @throws ApiError
   */
  public static getLoginUser(): CancelablePromise<BaseResponseLoginUserVO> {
    return __request(OpenAPI, {
      method: "GET",
      url: "/user/get/login",
    });
  }

  /**
   * @returns BaseResponseUserAcceptedQuestionVO OK
   * @throws ApiError
   */
  public static getUserCompletionOfTheQuestion(): CancelablePromise<BaseResponseUserAcceptedQuestionVO> {
    return __request(OpenAPI, {
      method: "GET",
      url: "/user/completion",
    });
  }

  /**
   * @returns BaseResponseTotalInfo OK
   * @throws ApiError
   */
  public static getTotalInfo(): CancelablePromise<BaseResponseTotalInfo> {
    return __request(OpenAPI, {
      method: "GET",
      url: "/user/total",
    });
  }

  /**
   * @returns BaseResponseListLong OK
   * @throws ApiError
   */
  public static getMyAcceptedQuestion(): CancelablePromise<BaseResponseListLong> {
    return __request(OpenAPI, {
      method: "GET",
      url: "/user/myAcceptedQuestion",
    });
  }
}
